<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章管理</title>
<#include "/admin/include/head.htm">
<#include "/admin/include/upload.ftl">
<script type="text/javascript" src="${base}/resource/thirdparty/editor/kindeditor.js"></script>
<script type="text/javascript" src="${base}/resource/js/input.js"></script>
<script type="text/javascript">
	function selectCategory(){
		$.ligerDialog.open({ url: base + '${base}/admin/system/articleCategory/tree/3.jhtml', height: 400, width: 300, 
			buttons: [{ 
				text: '确定', onclick: function (item, dialog) { 
					var selectNode = dialog.frame.getSelectNode();
					if(!selectNode.id){
						LG.showError("请不要选择根栏目!");
						return;
					}
					addRelativeToObject({"category_id": selectNode.id, "category_name": selectNode.name});
					dialog.close();
				} 
			},{ text: '取消', onclick: function (item, dialog) { dialog.close(); } }
	         ], isResize: true
        });
	};
	$(function(){
		$(".browserButton").browser({uploadType:'article'});
	});
	//更改eidtor插件本地上传目录为文章目录
	setting.uploadType = "article";	
</script>
</head>
<#if !article??>
	<#assign isAdd = true />
<#else>
	<#assign isEdit = true /> 
</#if>
<body style="overflow:hidden;padding:10px;">
	<div id="tabcontainer" style="overflow:hidden;margin:3px;">
		<form action="<#if isAdd??>save.jhtml<#else>update.jhtml</#if>" method="post" class="validate" id="mainform">
			<input type="hidden" name="parentMenuNo" value="${(parentMenuNo)!''}"/>
			<#if !isAdd??>
			<input type="hidden" name="id" value="${(article.id)!''}" />
			</#if>
			<table class="table" style="width:100%;">
				<tr>
					<th>文章标题: </th>
					<td>
						<input type="text" name="title" class="formText {required: true,maxlength: 128}" 
							value="${(article.title)!''}" style="width: 500px;"/>
					</td>
				</tr>
				<tr>
					<th>标题图片：</th>
					<td>
						<input type="text" value="${(article.titleImg)!''}" name="titleImg" class="formText">
						<input type="button" value="选择图片" class="button browserButton">
					</td>									
				</tr>
				<tr>
					<th>简介（页面描述）: </th>
					<td>
						<textarea rows="3" cols="80" name="metaDescription" class="{maxlength: 80}" >${(article.metaDescription)!''}</textarea>
					</td>
				</tr>
				<tr>
					<th>文章分类:</th>
					<td>
						<input type="text" class="formText {required: true}" id="category_name" value="${((article.category.name)!cate.name)!''}" 
								title="点击后弹出" onfocus="selectCategory();" readonly="readonly"/>
						<input type="hidden" id="category_id" name="category.id" value="${((article.category.id)!cate.id)!''}" />
					</td>
				</tr>
				<tr>
					<th>是否首页置顶：</th>	
					<td><@u.radio name= "isTop" list={"true":"是", "false": "否"} 
							value="${(article.isTop?string('true', 'false'))!'false'}"/>
					</td>									
				</tr>
				<tr>
					<th>是否推荐：</th>	
					<td><@u.radio name= "isRecommend" list={"true":"是", "false": "否"} 
							value="${(article.isRecommend?string('true', 'false'))!'false'}"/>
					</td>									
				</tr>
				<tr>
					<th>是否禁用：</th>	
					<td><@u.radio name= "isDisabled" list={"true":"是", "false": "否"} 
							value="${(article.isDisabled?string('true', 'false'))!'false'}"/>
					</td>									
				</tr>
				<tr>
					<th>出处:</th>
					<td><input type="text" class="formText {required: true,maxlength: 20}" name="source" value="${(article.source)!''}" /></td>
				</tr>
				<tr>
					<th>作者:</th>
					<td><input type="text" class="formText {required: true,maxlength: 20}" name="author" value="${(article.author)!''}" /></td>
				</tr>
				<#--<tr>
					<th>设置:</th>
					<td>
						<label>
							<input type="checkbox" name="isPublication" value="true" id="article_isPublication" 
								<#if !isAdd?? && article.isPublication?? && article.isPublication> checked="checked"</#if> />发布
						</label>
						<label>
							<input type="checkbox" name="isRecommend" value="true" id="article_isRecommend" 
								<#if !isAdd?? && article.isRecommend?? && article.isRecommend> checked="checked"</#if> />推荐
						</label>
						<label>
							<input type="checkbox" name="isTop" value="true" id="article_isTop" 
								<#if !isAdd?? && article.isTop?? && article.isTop> checked="checked"</#if> />置顶
						</label>
					</td>
				</tr>-->
				<tr>
					<th>内容: </th>
					<td>
						<textarea id="editor" name="content" class="editor" style="width: 100%;">${(article.content)!''}</textarea>
					</td>
				</tr>
				<tr>
					<th>&nbsp;</th>
					<td>
						<span class="warnInfo"><span class="icon">&nbsp;</span>提示: 若需要强制分页,请在文章内容中插入 {nextPage} 标记</span>
					</td>
				</tr>
				<tr>
					<th>外部链接: </th>
					<td>
						<input type="text" class="formText {maxlength: 255}" name="outerUrl"  value="${(article.outerUrl)!''}" style="width: 300px;"/>
					</td>
				</tr>
				<#--<tr>
					<th>页面关键词: </th>
					<td>
						<input type="text" class="formText {maxlength: 255}" name="metaKeywords"  value="${(article.metaKeywords)!''}" />
					</td>
				</tr>
				<tr>
					<th>页面描述: </th>
					<td>
						<textarea name="metaDescription" id="article.metaDescription" class="formTextarea {maxlength: 255}">${(article.metaDescription)!''}</textarea>
					</td>
				</tr>-->
			</table>
			<#include "/admin/include/form-bar.ftl">
		</form>
	</div>
</body>
</html>